#ifndef CIOPS_OP_DELETE_H
#define CIOPS_OP_DELETE_H

#include "Operation.h"

namespace CIOps {
    /**
     * This class represents the operation to delete the selected primitives
     **/
    class OP_Delete : public Operation {    

    public:            
        OP_Delete (std::vector<CIView::View*>& v);       //Constructor
        virtual ~OP_Delete();                           //Destructor

    protected:
        std::map<CIGeom::Geometry*, std::pair<std::vector<CICore::Vertex*>, std::vector<CICore::Face*> > > oldPrimitives;
        std::vector<CICore::Vertex*> verticesToDelete;
        std::vector<CICore::Face*> facesToDelete;


        void DeleteSelectedPrimitives();            //Method called to delete the primitives currently selected
        void DeleteSelectedVertices();              //Method called to delete the vertices currently selected
        void DeleteSelectedFaces();                 //Method called to delete the faces currently selected

    public:            
        //Utility Methods
        virtual int Exec();         //Method called to execute directly the operation
        virtual void Undo();        //Method called to undo the operation
        virtual void Redo();        //Method called to redo the operation

        virtual void MousePressEvent (CIView::View* view, QMouseEvent* e);        //Mouse Pressed event handler
        virtual void MouseReleaseEvent (CIView::View* view, QMouseEvent* e);      //Mouse Released event handler
        virtual void MouseMoveEvent (CIView::View* view, QMouseEvent* e);         //Mouse Moved event handler
        virtual void WheelEvent (CIView::View* view, QWheelEvent* e);             //Wheel event handler
    };
}

#endif /* CIOPS_OP_DELETE_H */
